<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"> 
<head> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 
<title>省略号 test</title> 
<style type="text/css"> 
*{ 
margin:0; 
padding:0; 
} 
body{ 
padding:10px; 
font-family:Arial; 
} 
#test { 
position:relative; 
width:150px; 
height:20px; 
line-height:20px; 
text-overflow:ellipsis; 
white-space:nowrap; 
*white-space:nowrap; 
overflow:hidden; 
border:1px solid #999; 
} 
#test span{ 
position:absolute; 
top:0; 
right:0; 
display:block; 
float:left; 
} 

</style> 
</head> 
<body> 
<div id="test">小虾奋斗起来吧，加油加油加油加油加油加油</div> 
</body> 
</html>
